package com.dpiinc.TechPage.room.dao;
import com.dpiinc.TechPage.room.bean.PenEntity;

import java.util.List;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

/**
 * Created by hu489_000 on 2018-07-01.
 */

@Dao
public interface PenDao {

    @Query("SELECT * FROM PenEntity")
    List<PenEntity> getAll();

    @Query("SELECT * FROM PenEntity WHERE penId IN (:penIda)")
    List<PenEntity> getAllByIds(long[] penIda);

    @Query("SELECT * FROM PenEntity WHERE macAddress = :macAddress ")
    PenEntity getPenByMacAddress(String macAddress);

    @Insert
    void insert(PenEntity... entities);

    @Query("DELETE FROM PenEntity")
    public void clearTable();

    @Delete
    void delete(PenEntity entity);

    @Update
    void update(PenEntity entity);
}
